﻿using System;
using System.ServiceModel;
using FlickrSL.Channels;
using FlickrSL.Data;
using SilverlightRestServices.Description;

namespace FlickrSL
{
    [ServiceContract]
    [RestService]
    [FlickrSecurity]
    public partial interface Flickr
    {
        [OperationContract(AsyncPattern = true)]
        [RestGet("services/rest/?method=flickr.photos.getAllContexts&photo_id={0}")]
        IAsyncResult BeginPhotos_GetAllContexts(Int64 photoId, AsyncCallback callback, Object state);

        void EndPhotos_GetAllContexts(IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        [RestGet("services/rest/?method=flickr.photos.getContext&photo_id={0}")]
        IAsyncResult BeginPhotos_GetContext(Int64 photoId, AsyncCallback callback, Object state);

        FlickrResponse<PhotoContext> EndPhotos_GetContext(IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        [RestGet("services/rest/?method=flickr.photos.getExif&photo_id={0}")]
        IAsyncResult BeginPhotos_GetExif(Int64 photoId, AsyncCallback callback, Object state);

        FlickrResponse<ExifTagCollection> EndPhotos_GetExif(IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        [RestGet("services/rest/?method=flickr.photos.getExif&photo_id={0}&secret={1}")]
        IAsyncResult BeginPhotos_GetSharedExif(Int64 photoId, String secret, AsyncCallback callback, Object state);

        FlickrResponse<ExifTagCollection> EndPhotos_GetSharedExif(IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        [RestGet("services/rest/?method=flickr.photos.getInfo&photo_id={0}")]
        IAsyncResult BeginPhotos_GetPhotoInfo(Int64 photoId, AsyncCallback callback, Object state);

        FlickrResponse<PhotoInfo> EndPhotos_GetPhotoInfo(IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        [RestGet("services/rest/?method=flickr.photos.getInfo&photo_id={0}&secret={1}")]
        IAsyncResult BeginPhotos_GetSharedPhotoInfo(Int64 photoId, String secret, AsyncCallback callback, Object state);

        FlickrResponse<PhotoInfo> EndPhotos_GetSharedPhotoInfo(IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        [RestGet("services/rest/?method=flickr.photos.getSizes&photo_id={0}")]
        IAsyncResult BeginPhotos_GetSizes(Int64 photoId, AsyncCallback callback, Object state);

        FlickrResponse<SizeCollection> EndPhotos_GetSizes(IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        [RestGet("services/rest/?method=flickr.photos.getRecent")]
        IAsyncResult BeginPhotos_GetRecent(AsyncCallback callback, Object state);

        FlickrResponse<PhotoCollection> EndPhotos_GetRecent(IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        [RestGet("services/rest/?method=flickr.photos.getRecent&page={0}&per_page={1}")]
        IAsyncResult BeginPhotos_GetRecentPage(Int32 page, Int32 perPage, AsyncCallback callback, Object state);

        FlickrResponse<PhotoCollection> EndPhotos_GetRecentPage(IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        [RestGet("services/rest/?method=flickr.photos.getRecent&extra={0}")]
        IAsyncResult BeginPhotos_GetRecentEx(PhotoFieldCollection extraFields, AsyncCallback callback, Object state);

        FlickrResponse<PhotoCollection> EndPhotos_GetRecentEx(IAsyncResult result);

        [OperationContract(AsyncPattern = true)]
        [RestGet("services/rest/?method=flickr.photos.getRecent&extra={0}&page={0}&per_page={1}")]
        IAsyncResult BeginPhotos_GetRecentPageEx(PhotoFieldCollection extraFields, AsyncCallback callback, Object state);

        FlickrResponse<PhotoCollection> EndPhotos_GetRecentPageEx(IAsyncResult result);
    }
}
